<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:tns="http://schemas.datacontract.org/2004/07/EAppointments.BMS.Services.Contracts" xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/" elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07/EAppointments.BMS.Services.Contracts" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:import schemaLocation="http://localhost:24444/EAppointments.BMS.Host/AppointmentService.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/" />
  <xs:complexType name="AppointmentSearchCriteria">
    <xs:sequence>
      <xs:element minOccurs="0" name="Ubrn" nillable="true" type="xs:int" />
      <xs:element minOccurs="0" name="Status" nillable="true" type="xs:int" />
      <xs:element minOccurs="0" name="PatientId" nillable="true" type="ser:guid" />
      <xs:element minOccurs="0" name="ReferrerId" nillable="true" type="ser:guid" />
      <xs:element minOccurs="0" name="ProviderId" nillable="true" type="ser:guid" />
      <xs:element minOccurs="0" name="StartDateTime" nillable="true" type="xs:dateTime" />
      <xs:element minOccurs="0" name="EndDateTime" nillable="true" type="xs:dateTime" />
      <xs:element minOccurs="0" name="CreatedDateTime" nillable="true" type="xs:dateTime" />
      <xs:element minOccurs="0" name="WorkflowId" nillable="true" type="ser:guid" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="AppointmentSearchCriteria" nillable="true" type="tns:AppointmentSearchCriteria" />
  <xs:complexType name="AppointmentCollection">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="Appointment" nillable="true" type="tns:Appointment" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="AppointmentCollection" nillable="true" type="tns:AppointmentCollection" />
  <xs:complexType name="Appointment">
    <xs:sequence>
      <xs:element minOccurs="0" name="UBRN" type="xs:int" />
      <xs:element name="Patient" nillable="true" type="tns:Patient" />
      <xs:element name="Referrer" nillable="true" type="tns:Referrer" />
      <xs:element name="Provider" nillable="true" type="tns:Provider" />
      <xs:element name="ClinicType" nillable="true" type="tns:ClinicType" />
      <xs:element minOccurs="0" name="Slot" nillable="true" type="tns:Slot" />
      <xs:element minOccurs="0" name="StartDateTime" nillable="true" type="xs:dateTime" />
      <xs:element minOccurs="0" name="EndDateTime" nillable="true" type="xs:dateTime" />
      <xs:element minOccurs="0" name="CreatedDateTime" type="xs:dateTime" />
      <xs:element minOccurs="0" name="UpdatedDateTime" type="xs:dateTime" />
      <xs:element minOccurs="0" name="CancelledDateTime" nillable="true" type="xs:dateTime" />
      <xs:element minOccurs="0" name="CancelledBy" nillable="true" type="ser:guid" />
      <xs:element minOccurs="0" name="CancellationReason" nillable="true" type="xs:string" />
      <xs:element minOccurs="0" name="Status" type="tns:AppointmentStatus" />
      <xs:element minOccurs="0" name="Comments" nillable="true" type="xs:string" />
      <xs:element minOccurs="0" name="ReminderDate" nillable="true" type="xs:dateTime" />
      <xs:element minOccurs="0" name="WorkflowId" nillable="true" type="ser:guid" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="Appointment" nillable="true" type="tns:Appointment" />
  <xs:complexType name="Patient">
    <xs:sequence>
      <xs:element name="Id" type="ser:guid" />
      <xs:element name="PatientNo" nillable="true" type="xs:string" />
      <xs:element minOccurs="0" name="Title" nillable="true" type="xs:string" />
      <xs:element minOccurs="0" name="FirstName" nillable="true" type="xs:string" />
      <xs:element minOccurs="0" name="LastName" nillable="true" type="xs:string" />
      <xs:element minOccurs="0" name="Gender" type="ser:char" />
      <xs:element minOccurs="0" name="DateOfBirth" nillable="true" type="xs:dateTime" />
      <xs:element minOccurs="0" name="AddressLine1" nillable="true" type="xs:string" />
      <xs:element minOccurs="0" name="AddressLine2" nillable="true" type="xs:string" />
      <xs:element minOccurs="0" name="City" nillable="true" type="xs:string" />
      <xs:element minOccurs="0" name="State" nillable="true" type="xs:string" />
      <xs:element minOccurs="0" name="Country" nillable="true" type="xs:string" />
      <xs:element minOccurs="0" name="ZipCode" nillable="true" type="xs:string" />
      <xs:element minOccurs="0" name="ContactNumber" nillable="true" type="xs:string" />
      <xs:element minOccurs="0" name="Email" nillable="true" type="xs:string" />
      <xs:element name="Referrer" nillable="true" type="tns:Referrer" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="Patient" nillable="true" type="tns:Patient" />
  <xs:complexType name="Referrer">
    <xs:sequence>
      <xs:element name="Id" type="ser:guid" />
      <xs:element name="FirstName" nillable="true" type="xs:string" />
      <xs:element name="LastName" nillable="true" type="xs:string" />
      <xs:element minOccurs="0" name="ClinicName" nillable="true" type="xs:string" />
      <xs:element minOccurs="0" name="Email" nillable="true" type="xs:string" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="Referrer" nillable="true" type="tns:Referrer" />
  <xs:complexType name="Provider">
    <xs:sequence>
      <xs:element name="Id" type="ser:guid" />
      <xs:element name="Name" nillable="true" type="xs:string" />
      <xs:element name="Location" nillable="true" type="xs:string" />
      <xs:element name="Organization" nillable="true" type="xs:string" />
      <xs:element name="Email" nillable="true" type="xs:string" />
      <xs:element name="Latitude" type="xs:double" />
      <xs:element name="Longitude" type="xs:double" />
      <xs:element name="ConditionsTreated" nillable="true" type="xs:string" />
      <xs:element name="ProceduresPerformed" nillable="true" type="xs:string" />
      <xs:element name="Exclusions" nillable="true" type="xs:string" />
      <xs:element name="AlternativeServices" nillable="true" type="xs:string" />
      <xs:element name="Proximity" type="xs:double" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="Provider" nillable="true" type="tns:Provider" />
  <xs:complexType name="ClinicType">
    <xs:sequence>
      <xs:element name="Id" type="ser:guid" />
      <xs:element name="Specialty" nillable="true" type="tns:Specialty" />
      <xs:element name="Name" nillable="true" type="xs:string" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="ClinicType" nillable="true" type="tns:ClinicType" />
  <xs:complexType name="Specialty">
    <xs:sequence>
      <xs:element name="Id" type="ser:guid" />
      <xs:element name="Name" nillable="true" type="xs:string" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="Specialty" nillable="true" type="tns:Specialty" />
  <xs:complexType name="Slot">
    <xs:sequence>
      <xs:element name="Id" type="ser:guid" />
      <xs:element minOccurs="0" name="Provider" nillable="true" type="tns:Provider" />
      <xs:element minOccurs="0" name="ClinicType" nillable="true" type="tns:ClinicType" />
      <xs:element minOccurs="0" name="StartDateTime" type="xs:dateTime" />
      <xs:element minOccurs="0" name="EndDateTime" type="xs:dateTime" />
      <xs:element minOccurs="0" name="UBRN" nillable="true" type="xs:int" />
      <xs:element minOccurs="0" name="Status" type="tns:SlotStatus" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="Slot" nillable="true" type="tns:Slot" />
  <xs:simpleType name="SlotStatus">
    <xs:restriction base="xs:string">
      <xs:enumeration value="All" />
      <xs:enumeration value="Available" />
      <xs:enumeration value="Booked" />
    </xs:restriction>
  </xs:simpleType>
  <xs:element name="SlotStatus" nillable="true" type="tns:SlotStatus" />
  <xs:simpleType name="AppointmentStatus">
    <xs:restriction base="xs:string">
      <xs:enumeration value="None" />
      <xs:enumeration value="Pending" />
      <xs:enumeration value="Booked" />
      <xs:enumeration value="Approved">
        <xs:annotation>
          <xs:appinfo>
            <EnumerationValue xmlns="http://schemas.microsoft.com/2003/10/Serialization/">4</EnumerationValue>
          </xs:appinfo>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Cancelled">
        <xs:annotation>
          <xs:appinfo>
            <EnumerationValue xmlns="http://schemas.microsoft.com/2003/10/Serialization/">8</EnumerationValue>
          </xs:appinfo>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Rejected">
        <xs:annotation>
          <xs:appinfo>
            <EnumerationValue xmlns="http://schemas.microsoft.com/2003/10/Serialization/">16</EnumerationValue>
          </xs:appinfo>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="Elapsed">
        <xs:annotation>
          <xs:appinfo>
            <EnumerationValue xmlns="http://schemas.microsoft.com/2003/10/Serialization/">32</EnumerationValue>
          </xs:appinfo>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:element name="AppointmentStatus" nillable="true" type="tns:AppointmentStatus" />
  <xs:complexType name="AppointmentServiceFault">
    <xs:sequence>
      <xs:element minOccurs="0" name="Message" nillable="true" type="xs:string" />
      <xs:element minOccurs="0" name="Id" type="ser:guid" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="AppointmentServiceFault" nillable="true" type="tns:AppointmentServiceFault" />
  <xs:complexType name="SystemFault">
    <xs:sequence>
      <xs:element minOccurs="0" name="Message" nillable="true" type="xs:string" />
      <xs:element minOccurs="0" name="Id" type="ser:guid" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="SystemFault" nillable="true" type="tns:SystemFault" />
</xs:schema>